import React, { PropTypes } from 'react';
import { Router, Route, IndexRoute, Link } from 'react-router';
import App from '../components/App';
import NotFound from '../pages/NotFound';

import MainLayout from '../layouts/MainLayout/MainLayout';

import Login from '../pages/Login';
import User from '../pages/User';
import Member from '../pages/Member';
import Room from '../pages/Room';
import Cashier from '../pages/cashier';

import Index from '../pages/Index';
import Estate from '../pages/Estate';

import UserCenter from '../pages/user/UserCenter';
import UserInto from '../pages/user/UserInto';

//会员管理
import MemberList from '../pages/member/MemberList';
import MemberTable from '../pages/member/MemberTable';
import ScoreRecord from '../pages/member/ScoreRecord';
import UpRecord from '../pages/member/UpRecord';
import MemberClassify from '../pages/member/MemberClassify';
import ShopsClassify from '../pages/member/ShopsClassify';
import MCardClassify from '../pages/member/MCardClassify';
import FeeClassify from '../pages/member/FeeClassify';
import ScoreClassify from '../pages/member/ScoreClassify';

//房源管理
import CityList from '../pages/room/CityList';
import AreaList from '../pages/room/AreaList';
import HousesList from '../pages/room/HousesList';
import StylesList from '../pages/room/StylesList';
import BuildList from '../pages/room/BuildList';
import UnitList from '../pages/room/UnitList';
import FloorList from '../pages/room/FloorList';
import SourceList from '../pages/room/SourceList';
import CarList from '../pages/room/CarList';
import PayMethod from '../pages/room/PayMethod';
import PayCycle from '../pages/room/PayCycle';
import PayClassify from '../pages/room/PayClassify';
import RentRecord from '../pages/room/RentRecord';
import RoomClient from '../pages/room/RoomClient';
import SaleList from '../pages/room/SaleList';

//物业管理
import PayProject from '../pages/estate/PayProject';
import PayList from '../pages/estate/PayList';
import WPayMethod from '../pages/estate/PayMethod';
import PayStandard from '../pages/estate/PayStandard';
import PayTime from '../pages/estate/PayTime';
import PayRecord from '../pages/estate/PayRecord';
import ChartStat from '../pages/estate/ChartStat';

//收银结算
import CashierPage from '../pages/cashier/CashierPage';
import CashierList from '../pages/cashier/CashierList';
import CashierRefund from '../pages/cashier/CashierRefund';
import ClearingApply from '../pages/cashier/ClearingApply';
import ClearingList from '../pages/cashier/ClearingList';
import EvaluateOrder from '../pages/cashier/EvaluateOrder';
import EvaluateAdvice from '../pages/cashier/EvaluateAdvice';

const Routes = ({ history }) =>
  <Router history={history}>
    <Route path="/" component={App}>
      <IndexRoute component={Login}/>
      <Route path="login" component={Login} />
      <Route path="app" component={MainLayout}>
        <Route path ="index" component={Index} />
      	<Route path ="user" component={User} >
            <IndexRoute component={UserCenter}/>
            <Route path="center" component={UserCenter} />
            <Route path="into" component={UserInto} />
        </Route>
        <Route path ="member" component={Member} >
            <IndexRoute component={MemberList}/>
            <Route path="list" component={MemberList} />
            <Route path="table" component={MemberTable} />
            <Route path="record" component={ScoreRecord} />
            <Route path="up" component={UpRecord} />
            <Route path="classify" component={MemberClassify} />
            <Route path="shops" component={ShopsClassify} />
            <Route path="card" component={MCardClassify} />
            <Route path="fee" component={FeeClassify} />
            <Route path="score" component={ScoreClassify} />
        </Route>
        <Route path ="room" component={Room} >
            <IndexRoute component={CityList}/>
            <Route path="city/list" component={CityList} />
            <Route path="city/area" component={AreaList} />
            <Route path="project/list" component={HousesList} />
            <Route path="house/style" component={StylesList} />
            <Route path="house/build" component={BuildList} />
            <Route path="house/unit" component={UnitList} />
            <Route path="house/floor" component={FloorList} />
            <Route path="house/source" component={SourceList} />
            <Route path="house/car" component={CarList} />
            <Route path="cost/pay" component={PayMethod} />
            <Route path="cost/cycle" component={PayCycle} />
            <Route path="cost/classify" component={PayClassify} />
            <Route path="voucher/rent" component={RentRecord} />
            <Route path="voucher/sale" component={SaleList} />
            <Route path="voucher/client" component={RoomClient} />
        </Route>
        <Route path ="estate" component={Estate} >
            <IndexRoute component={PayProject}/>
            <Route path="project" component={PayProject} />
            <Route path="payment" component={PayList} />
            <Route path="method" component={WPayMethod} />
            <Route path="standard" component={PayStandard} />
            <Route path="time" component={PayTime} />
            <Route path="record" component={PayRecord} />
            <Route path="stat" component={ChartStat} />
        </Route>
        <Route path ="cashier" component={Cashier} >
            <IndexRoute component={CashierPage}/>
            <Route path="cashier/page" component={CashierPage} />
            <Route path="cashier/list" component={CashierList} />
            <Route path="cashier/refund" component={CashierRefund} />
            <Route path="clearing/apply" component={ClearingApply} />
            <Route path="clearing/list" component={ClearingList} />
            <Route path="evaluate/order" component={EvaluateOrder} />
            <Route path="evaluate/advice" component={EvaluateAdvice} />
        </Route>
      </Route>
      <Route path="*" component={NotFound}/>
    </Route>
  </Router>;

Routes.propTypes = {
  history: PropTypes.any,
};

export default Routes;
